﻿CREATE TABLE [dbo].[Rank](
	[PlayerID] [int] NOT NULL,
	[Rank] [int] NULL,
	[AverageRank] [decimal](17, 2) NULL,
	[RecordsCount] [int] NULL,
	[ChallengesCount] [int] NULL,
	[Score] [decimal](17, 2) NULL,
 CONSTRAINT [PK_Rank] PRIMARY KEY CLUSTERED 
(
	[PlayerID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Rank]  WITH CHECK ADD  CONSTRAINT [FK_Rank_Player] FOREIGN KEY([PlayerID])
REFERENCES [dbo].[Player] ([ID])
GO

ALTER TABLE [dbo].[Rank] CHECK CONSTRAINT [FK_Rank_Player]
GO

CREATE UNIQUE NONCLUSTERED INDEX [IX_Rank] ON [dbo].[Rank] 
(
	[Rank] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO